<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>


<s:layout-render name="/backend/layout.jsp" title="moduleNames.administrators" selectedPage="administrators">
    <s:layout-component name="body">

        <div class="table">
            <table class="listing" cellpadding="0" cellspacing="0">
                <img src="${pageContext.request.contextPath}/backend/img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> 
                <img src="${pageContext.request.contextPath}/backend/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                <tr>
                    <th class="first"><f:message key="entities.customer.first_name" /></th>
                    <th><f:message key="entities.customer.surname" /></th>
                    <th><f:message key="global.username" /></th>
                    <th><f:message key="global.edit" /></th>
                    <th class="last"><f:message key="global.delete" /></th>                    
                </tr>
                <% int i = 0;  %>
                <c:forEach var="administrator" items="${actionBean.getList()}" >
                    <tr <% if(i%2 == 0){ out.print(" class='bg' "); } i++; %>>                       
                        <td class="first_style1"><c:out  value="${administrator.firstName}"/></td>
                        <td><c:out value="${administrator.surName}"/></td>
                        <td><c:out value="${administrator.username}"/></td>
                        <td><s:link beanclass="cz.muni.fi.pa165.bookingmanager.web.AdministratorActionBean" event="edit"><s:param name="administrator.id" value="${administrator.id}" /><img src="${pageContext.request.contextPath}/backend/img/edit-icon.gif" /></s:link></td>
                        <td class="last"><s:link onclick="return confirm_delete()" beanclass="cz.muni.fi.pa165.bookingmanager.web.AdministratorActionBean" event="delete"><s:param name="administrator.id" value="${administrator.id}" /><img src="${pageContext.request.contextPath}/backend/img/hr.gif" /></s:link></td>
                    </tr>
                 
                </c:forEach>
           </table>                 
           </div>
           <s:form beanclass="cz.muni.fi.pa165.bookingmanager.web.AdministratorActionBean">               
               <c:import url="form.jsp">
                   <c:param name="header" value="global.add" />
               </c:import>               
               <s:submit class="button" name="add"><f:message key="global.add"/></s:submit>
           </s:form>
           
    </s:layout-component>
</s:layout-render>
